const path = require('path')
module.exports = {
    mode: 'none',
    entry: './src/index.js',
    output: {
        filename: 'bundle.js',
        path: path.join(__dirname, 'dist'),
        publicPath: 'dist/'
    },
    module: {
        rules: [
            {
                test: /.js$/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['@babel/preset-env']
                    }
                }
            },
            {
                test: /.css$/,
                use: ['style-loader','css-loader']
            },
            {
                test: /.png$/,
                use:{ 
                    loader: 'url-loader',
                    options: {
                        limit: 10 * 1024
                    }
                
                }
            },
            {
                // 默认只处理img标签的src
                test: /.html$/,
                use: {
                    loader: 'html-loader',
                    options: {
                        attrs: ['img:src','a:href']
                    }
                }
            }
        ]
    }
}